<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>Pool (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">structs.Pool</span>
        <span>Extends</span>
        <span class="fn-name">
          <a href="class_goog_Disposable.html">
          goog.Disposable
</a>
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    A generic pool class. If min is greater than max, an error is thrown.

  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_structs_pool.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/structs/pool.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td><span class="type"><a href="class_goog_Disposable.html">goog.Disposable</a></span></td><td></td></tr>
  <tr><td>goog.structs.Pool</td><td><span class="type"><a href="class_goog_Disposable.html">goog.Disposable</a></span></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
      <tr><td><span class="type"><a href="class_goog_net_XhrIoPool.html">goog.net.XhrIoPool</a></span></td><td><span class="type"><a href="class_goog_structs_PriorityPool.html">goog.structs.PriorityPool</a></span></td></tr>
        <tr><td><span class="type"><a href="class_goog_testing_net_XhrIoPool.html">goog.testing.net.XhrIoPool</a></span></td><td><span class="type"><a href="class_goog_net_XhrIoPool.html">goog.net.XhrIoPool</a></span></td></tr>
        <tr><td><span class="type"><a href="class_goog_structs_PriorityPool.html">goog.structs.PriorityPool</a></span></td><td>goog.structs.Pool</td></tr>
  </table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.structs.Pool(<span><span class="arg">opt_minCount</span>,&nbsp;<span class="arg">opt_maxCount</span></span>)
  </div>

   <h3>Parameters</h3>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">opt_minCount</span>
        : <span class="type">number=</span>
        <div class="entryOverview">Min. number of objects (Default: 1).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_maxCount</span>
        : <span class="type">number=</span>
        <div class="entryOverview">Max. number of objects (Default: 10).</div>
     </td>
   </tr>
  </table>


<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_structs_Pool.html">
              goog.structs.Pool
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.addFreeObject"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">addFreeObject<span class="args">(<span class="arg">obj</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Adds an object to the collection of objects that are free. If the object can
not be added, then it is disposed.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">obj</span>
        : <span class="type">T</span>
        <div class="entryOverview">The object to add to collection of free objects.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line237">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.adjustForMinMax"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">adjustForMinMax<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Adjusts the objects held in the pool to be within the min/max constraints.

NOTE: It is possible that the number of objects in the pool will still be
greater than the maximum count of objects allowed. This will be the case
if no more free objects can be disposed of to get below the minimum count
(i.e., all objects are in use).

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line255">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.contains"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">contains<span class="args">(<span class="arg">obj</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Returns true if the given object is in the pool.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">obj</span>
        : <span class="type">T</span>
        <div class="entryOverview">The object to check the pool for.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the pool contains the object.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line317">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.createObject"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">createObject<span class="args">()</span>
        </span>
        &#8658; <span class="type">T</span>
      </div>


     <div class="entryOverview">
       Should be overridden by sub-classes to return an instance of the object type
that is expected in the pool.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">T</span>&nbsp;
            The created object.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line275">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry protected">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.disposeInternal"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">disposeInternal<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Disposes of the pool and all objects currently held in the pool.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line363">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.disposeObject"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">disposeObject<span class="args">(<span class="arg">obj</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Should be overridden to dispose of an object. Default implementation is to
remove all its members, which should render it useless. Calls the object's
<code> dispose()</code> method, if available.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">obj</span>
        : <span class="type">T</span>
        <div class="entryOverview">The object to dispose.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line286">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.getCount"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getCount<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the number of objects currently in the pool.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Number of objects currently in the pool.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line326">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.getFreeCount"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getFreeCount<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the number of objects currently free in the pool.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Number of objects currently free in the pool.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line344">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.getInUseCount"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getInUseCount<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the number of objects currently in use in the pool.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Number of objects currently in use in the pool.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line335">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.getObject"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getObject<span class="args">()</span>
        </span>
        &#8658; <span class="type">T</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">T</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>&nbsp;
            A new object from the pool if there is one available,
    otherwise undefined.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line169">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.isEmpty"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">isEmpty<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Determines if the pool contains no objects.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the pool contains no objects.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line353">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.objectCanBeReused"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">objectCanBeReused<span class="args">(<span class="arg">obj</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Should be overridden to determine whether an object has become unusable and
should not be returned by getObject(). Calls the object's
<code> canBeReused()</code>  method, if available.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">obj</span>
        : <span class="type">T</span>
        <div class="entryOverview">The object to test.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the object can be reused.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line304">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.releaseObject"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">releaseObject<span class="args">(<span class="arg">obj</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Returns an object to the pool of available objects so that it can be reused.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">obj</span>
        : <span class="type">T</span>
        <div class="entryOverview">The object to return to the pool of free objects.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the object was found in the Pool's set of in-use
    objects (in other words, whether any action was taken).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line192">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.removeFreeObject_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">removeFreeObject_<span class="args">()</span>
        </span>
        &#8658; <span class="type">T</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>
      </div>


     <div class="entryOverview">
       Removes a free object from the collection of objects that are free so that it
can be used.

NOTE: This method does not mark the returned object as in use.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">T</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>&nbsp;
            The object removed from the free collection, if there
    is one available. Otherwise, undefined.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line211">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.setDelay"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">setDelay<span class="args">(<span class="arg">delay</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets the minimum delay between objects being returned by getObject, in
milliseconds. This defaults to zero, meaning that no minimum delay is
enforced and objects may be used as soon as they're available.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">delay</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The minimum delay, in milliseconds.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line160">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.setMaximumCount"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">setMaximumCount<span class="args">(<span class="arg">max</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets the maximum count of the pool.
If max is less than the max count of the pool, an error is thrown.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">max</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The maximum count of the pool.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line142">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.Pool.prototype.setMinimumCount"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">setMinimumCount<span class="args">(<span class="arg">min</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets the minimum count of the pool.
If min is greater than the max count of the pool, an error is thrown.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">min</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The minimum count of the pool.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line125">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>

<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_Disposable.html">
              goog.Disposable
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.Disposable.prototype.addOnDisposeCallback"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">addOnDisposeCallback<span class="args">(<span class="arg">callback</span>,&nbsp;<span class="arg">opt_scope</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">callback</span>
        : <span class="type">function(this:T</span>)<span>:?</span>
        <div class="entryOverview">The callback function.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_scope</span>
        : <span class="type">T=</span>
        <div class="entryOverview">An optional scope to call the callback in.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_disposable_disposable.js.source.html#line211">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.Disposable.prototype.dispose"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">dispose<span class="args">()</span>
        </span>
        &#8658; <span class="type">void</span>
      </div>


     <div class="entryOverview">
       Disposes of the object. If the object hasn't already been disposed of, calls
<code> #disposeInternal</code>. Classes that extend <code> goog.Disposable</code> should
override <code> #disposeInternal</code> in order to delete references to COM
objects, DOM nodes, and other disposable objects. Reentrant.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">void</span>&nbsp;
            Nothing.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_disposable_disposable.js.source.html#line172">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry protected">
       <td class="access"></td>






  <td>
    <a name="goog.Disposable.prototype.disposeInternal"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">disposeInternal<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Deletes or nulls out any references to COM objects, DOM nodes, or other
disposable objects. Classes that extend <code> goog.Disposable</code> should
override this method.
Not reentrant. To avoid calling it twice, it must only be called from the
subclass' <code> disposeInternal</code> method. Everywhere else the public
<code> dispose</code> method must be used.
For example:
<pre class="lang-js prettyprint">
  mypackage.MyClass = function() {
    goog.base(this);
    // Constructor logic specific to MyClass.
    ...
  };
  goog.inherits(mypackage.MyClass, goog.Disposable);

  mypackage.MyClass.prototype.disposeInternal = function() {
    // Dispose logic specific to MyClass.
    ...
    // Call superclass's disposeInternal at the end of the subclass's, like
    // in C++, to avoid hard-to-catch issues.
    goog.base(this, 'disposeInternal');
  };
</pre>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_disposable_disposable.js.source.html#line245">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td class="deprecated">
    <a name="goog.Disposable.prototype.getDisposed"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getDisposed<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       <span class="deprecatedMessage">Use <code> #isDisposed</code> instead.</span>
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the object has been disposed of.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_disposable_disposable.js.source.html#line160">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.Disposable.prototype.isDisposed"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">isDisposed<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the object has been disposed of.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_disposable_disposable.js.source.html#line151">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.Disposable.prototype.registerDisposable"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">registerDisposable<span class="args">(<span class="arg">disposable</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Associates a disposable object with this object so that they will be disposed
together.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">disposable</span>
        : <span class="type"><a href="interface_goog_disposable_IDisposable.html">goog.disposable.IDisposable</a></span>
        <div class="entryOverview">that will be disposed when
    this object is disposed.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_disposable_disposable.js.source.html#line199">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Instance Properties</h2>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_structs_Pool.html">
              goog.structs.Pool
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.structs.Pool.prototype.constructor"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">constructor</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line40">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry protected">
       <td class="access"></td>





  <a name="goog.structs.Pool.prototype.delay"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">delay</span>
        : 
     </div>


     <div class="entryOverview">
       The minimum delay between objects being made available, in milliseconds. If
this is 0, no minimum delay is enforced.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line78">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.structs.Pool.prototype.freeQueue_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">freeQueue_</span>
        : <span class="type"><a href="class_goog_structs_Queue.html">goog.structs.Queue</a></span>
     </div>


     <div class="entryOverview">
       Set used to store objects that are currently in the pool and available
to be used.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line65">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.structs.Pool.prototype.inUseSet_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">inUseSet_</span>
        : <span class="type"><a href="class_goog_structs_Set.html">goog.structs.Set</a></span>
     </div>


     <div class="entryOverview">
       Set used to store objects that are currently in the pool and in use.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line71">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry protected">
       <td class="access"></td>





  <a name="goog.structs.Pool.prototype.lastAccess"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">lastAccess</span>
        : 
     </div>


     <div class="entryOverview">
       The time of the last object being made available, in milliseconds since the
epoch (i.e., the result of Date#toTime). If this is null, no access has
occurred yet.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line86">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.structs.Pool.prototype.maxCount_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">maxCount_</span>
        : 
     </div>


     <div class="entryOverview">
       Maximum number of objects allowed

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line53">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.structs.Pool.prototype.minCount_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">minCount_</span>
        : 
     </div>


     <div class="entryOverview">
       Minimum number of objects allowed

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line47">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>

<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_Disposable.html">
              goog.Disposable
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.Disposable.prototype.creationStack"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">creationStack</span>
        : 
     </div>


     <div class="entryOverview">
       If monitoring the goog.Disposable instances is enabled, stores the creation
stack trace of the Disposable instance.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_disposable_disposable.js.source.html#line144">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.Disposable.prototype.disposed_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">disposed_</span>
        : 
     </div>


     <div class="entryOverview">
       Whether the object has been disposed of.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_disposable_disposable.js.source.html#line128">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.Disposable.prototype.onDisposeCallbacks_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">onDisposeCallbacks_</span>
        : 
     </div>


     <div class="entryOverview">
       Callbacks to invoke when this object is disposed.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_disposable_disposable.js.source.html#line136">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>










<div class="section">
  <table class="horiz-rule">


  </table>
</div>



<h2>Static Properties</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.structs.Pool.ERROR_DISPOSE_UNRELEASED_OBJS_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.Pool.</span><span class="entryName">ERROR_DISPOSE_UNRELEASED_OBJS_</span>
        : 
     </div>


     <div class="entryOverview">
       Error to throw when the Pool is attempted to be disposed and it is asked to
make sure that there are no objects that are in use (i.e., haven't been
released).

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line116">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.structs.Pool.ERROR_MIN_MAX_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.Pool.</span><span class="entryName">ERROR_MIN_MAX_</span>
        : 
     </div>


     <div class="entryOverview">
       Error to throw when the max/min constraint is attempted to be invalidated.
I.e., when it is attempted for maxCount to be less than minCount.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line105">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.structs.Pool.superClass_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.structs.Pool.</span><span class="entryName">superClass_</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_pool.js.source.html#line40">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package structs</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="structs.Pool"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
